import request from '@/utils/request'
import { download } from '@/utils'
// 查询登录日志列表
export function list(query) {
  return request({
    url: '/monitor/logininfor/list',
    method: 'get',
    params: query
  })
}

// 删除登录日志
export function deleteApi(data) {
  return request({
    url: '/monitor/logininfor/delete',
    method: 'delete',
    data
  })
}

// 清空登录日志
export function cleanLogininfor() {
  return request({
    url: '/monitor/logininfor/clean',
    method: 'delete'
  })
}
export async function exportApi(form) {
  const r = await service({
    url: '/monitor/logininfor/export',
    method: 'get',
    responseType: 'blob',
    params
  })
  if (r) {
    const { blob } = r
    download(blob, `logininfor_${new Date().getTime()}.xlsx`)
  }
}